package com.skwen.android_room;

import com.skwen.android_room.bean.Books;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class GenerateUtils {


    private static String[] names = {"编码：隐匿在计算机软硬件背后的语言[2012]", "码农翻身：用故事给技术加点料[2018]",
            "程序员健康指南[2014]", "领域驱动设计：软件核心复杂性应对之道（修订版）[2016]", "图解 HTTP[2014]", "Effective Java 原书第 3 版[2019]",
            "码出高效：Java 开发手册[2018]", "互联网轻量级SSM框架解密：Spring、Spring MVC、MyBatis源码深度剖析[2019.3]",
            "Java 8 In Action 中文版[2016]", "实战 Java 高并发程序设计[2015]", "Java 设计模式[2018]", "Python 参考手册第 4 版[2016]",
            "Python3 网络爬虫开发实战[2018]", "Go Web 编程"};//14

    private static String[] author = {"[美]Charles Petzold 著 左飞 薛佟佟 译", "刘欣", "美]Joe Kutner 著 陈少芸 译", "[美]Eric Evans 著赵俐 盛海艳 刘霞 等 译",
            "[日]上野宣 著 于均良译", "[美]Joshua Bloch 著 俞黎敏 译", "杨冠宝(花名:孤尽) 高海慧(花名:鸣莎)", "李艳鹏 等", "[英]Raoul-Gabriel Urma [意]Mario Fusco [英]Alan Mycroft 著 陆明刚 劳佳 译",
            "葛一鸣 郭超", "刘伟", "[美]David M.Beazley 著 谢俊 等译", "崔庆才", "谢孟军"};


    public static List<Books> getGenerateData() {
        List<Books> list = new ArrayList<>();
        Books books;
        Random random = new Random();
        for (int i = 0; i < names.length; i++) {
            books = new Books();
            books.setName(names[i]);
            books.setAuthor(author[i]);
            books.setPrice(random.nextInt(10) * 10 + " 元");
            list.add(books);
        }
        return list;
    }


}
